<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\helpers\ActionButton;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\DecreeTypeSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Типы приказов';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="container decree-type-index">

    <h1 class="main-title"><?= Html::encode($this->title) ?></h1>

    <p>
        <?= ActionButton::create('Создать тип приказа', 'createDecreeType') ?>
    </p>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'tableOptions' => [
            'class' => 'table table-striped'
        ],
        'columns' => [
            'id',
            'title',
            'short_description',

            [
                'class' => 'yii\grid\ActionColumn',
                'visibleButtons' =>
                [
                    'view' => Yii::$app->user->can('browseDecreeType'),
                    'update' => Yii::$app->user->can('updateDecreeType'),
                    'delete' => Yii::$app->user->can('deleteDecreeType'),
                ]
            ],
        ],
    ]); ?>


</div>
